<?php

use Jialeo\LaravelSchemaExtend\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGroupUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('group_users', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('group_id')->comment('群ID');
            $table->integer('user_id')->comment('成员ID');
            $table->string('alias')->comment('用户在此群的昵称');
            $table->integer('read_id')->comment('最新已读消息ID');
            $table->timestamps();


            $table->comment = '群基本信息';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('group_users');
    }
}
